<template>
  <view>
    <course-list :courseList="courseList"></course-list>
  </view>
</template>

<script>
import request from "@/utils/request";

import courseList from "@/components/course-list.vue";
export default {
  data() {
    return {
      courseList: [],
    };
  },
  components: {
    courseList,
  },
  onLoad() {
    this.getCourseList();
  },
  methods: {
    async getCourseList() {
      const res = await request({ url: "course/list" });
      if (res.data.status === 0) {
        this.courseList = res.data.message;
      }
    },
  },
};
</script>
